#!/usr/bin/python
# -*- coding: utf-8 -*-

# #for循环
# #当i==l时停止循环
# str1 = 'hello'
# for i in str1:
#     if i == 'l':
#         break
#     print(i)
#
# print('----------------------------------------------------')
# #当i==l 时不打印，继续后面循环
# str1 = 'hello'
# for i in str1:
#     if i == 'l':
#         continue
#     print(i)


#while...else...
#break
# n = 0
# while n< 5:
#     if n == 2:
#         print('不真诚')
#         break
#     print('媳妇，我错了')
#     n += 1
# else:
#     print('媳妇原谅我了。')
#
#
# print('--------------------------------------------------')
# #continue
# n = 0
# while n< 5:
#     if n == 2:
#         print('这遍不真诚，继续')
#         n += 1
#         continue
#     print('媳妇，我错了')
#     n += 1
# else:
#     print('媳妇原谅我了。')


#for...else...
str1 = 'hello'
for i in str1:
    if i == 'e':
        break
    print(i)
else:
    print('正常结束后执行！')

print('---------------------------------------')
#continue
str1 = 'hello'
for i in str1:
    if i == 'e':
        continue
    print(i)
else:
    print('正常结束后执行！')